package com.sdp.right.db.sys_config.service.impl;

import org.springframework.stereotype.Service;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sdp.right.db.sys_config.mapper.SysConfigMapper;
import com.sdp.right.db.sys_config.service.ISysConfigService;
import com.sdp.right.entity.SysConfig;
import com.sdp.right.service.RemoveSystemService;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zsp
 * @since 2024-12-13
 */
@Service
@DS(value="right")
public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig> implements ISysConfigService,RemoveSystemService {

	@Override
	public SysConfig querySysConfigByParamCode(String paramCode) {
		LambdaQueryWrapper<SysConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>();
		lambdaQueryWrapper.eq(SysConfig::getParamCode, paramCode);
		return getOne(lambdaQueryWrapper,false);
	}

	@Override
	public void removeBySystemNo(String systemNo) {
		LambdaQueryWrapper<SysConfig> queryWrapper = new LambdaQueryWrapper<>();
		queryWrapper.eq(SysConfig::getSystemNo, systemNo);
		remove(queryWrapper);
	}

}
